Skip to content

feat(compass-app): revive embedded dual-mode + supervisor pipeline (RIG-3197, RIG-3198) - #844

Open
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-native/rig-3197-embedded-dual-mode-supervisor
Open

feat(compass-app): revive embedded dual-mode + supervisor pipeline (RIG-3197, RIG-3198)#844
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-native/rig-3197-embedded-dual-mode-supervisor

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Contributor

Reverse the RIG-2554 client-only retirement: embedded app mode returns alongside the surviving client mode, per the frozen embedded-revival design (docs/designs/ui/compass-native-embedded-revival/design.md, §A1/§A2/§A3/§A6 shell half). T-1 and T-2 land together because T-1 alone would flip the absent-app.toml default to a ModeEmbedded whose launch arm is only a transient error, and T-2 alone would not compile (embedded.go consumes T-1's appconfig API).

T-1 (RIG-3197) revives dual-mode in go/internal/appconfig: ModeEmbedded is added after ModeClient so ModeClient keeps the zero value; Parse resolves absent/empty/embedded mode to ModeEmbedded (the zero-config onboarding default) and rejects the client-only server_url/ca_cert fields under embedded mode legibly; Load gains the override parameter and resolves absent-file to the embedded default rather than a first-run error; the --mode/$COMPASS_APP_MODE override returns with flag>env>file>default precedence. The RIG-2554 retirement-error copy is deleted, not kept beside a working arm.

T-2 (RIG-3198) revives the in-process supervisor pipeline in go/cmd/compass-app (embedded.go, lifecycle.go, preflight_adapters.go) and the go/internal/preflight package, reconciled against current main rather than restored verbatim. The app supervises the stack through the compass-stack binary (fire-and-return): preflight then compass-stack up then a WhoAmI dial over the stack's Unix socket. Reconciliations: the app-side DSN duplicate and the DB preflight probe are dropped (postgres is now a DL-260 container the stack starts; up-Ready is the DB verification); stackUpArgs passes only up --state-dir --image --socket and none of the CLI-defaulted postgres/collector/listen flags; the revived files carry the current (linux && gtk4) || darwin build tags; the launch dispatch regains the two-arm switch handing bridge.NewUnixTarget(socket) plus the WhoAmI account id to the bridge service. Preflight v2 widens the OS check to linux|darwin, adds a darwin-only machine-ready seam (its adapter is a later task), drops the DB and uid checks (main's runner is uid-agnostic via the userns keep-id remap), and adds a fatal podman-version floor check that surfaces the podman 4.3+ requirement at the front door instead of deep inside a fire-and-return stack whose exit 0 hides the runner's own refusal. The bring-up timeout is raised to cover a three-image cold pull. shellStartupJS re-parameterizes on the resolved mode.

Ledger-impact: none
Refs RIG-1662
Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown

RIG-3197

RIG-3198

RIG-1662

@trunk-io

trunk-io Bot commented Sep 3, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-native-rig-3197-embe.compass-eng-docs.pages.dev

Deployed from compass-native/rig-3197-embedded-dual-mode-supervisor at 3b93f1f.

rigel-mintaka and others added 2 commits September 2, 2026 22:41
…IG-3197, RIG-3198)

Reverse the RIG-2554 client-only retirement: embedded app mode returns alongside the surviving client mode, per the frozen embedded-revival design (docs/designs/ui/compass-native-embedded-revival/design.md, §A1/§A2/§A3/§A6 shell half). T-1 and T-2 land together because T-1 alone would flip the absent-app.toml default to a ModeEmbedded whose launch arm is only a transient error, and T-2 alone would not compile (embedded.go consumes T-1's appconfig API).

T-1 (RIG-3197) revives dual-mode in go/internal/appconfig: ModeEmbedded is added after ModeClient so ModeClient keeps the zero value; Parse resolves absent/empty/embedded mode to ModeEmbedded (the zero-config onboarding default) and rejects the client-only server_url/ca_cert fields under embedded mode legibly; Load gains the override parameter and resolves absent-file to the embedded default rather than a first-run error; the --mode/$COMPASS_APP_MODE override returns with flag>env>file>default precedence. The RIG-2554 retirement-error copy is deleted, not kept beside a working arm.

T-2 (RIG-3198) revives the in-process supervisor pipeline in go/cmd/compass-app (embedded.go, lifecycle.go, preflight_adapters.go) and the go/internal/preflight package, reconciled against current main rather than restored verbatim. The app supervises the stack through the compass-stack binary (fire-and-return): preflight then compass-stack up then a WhoAmI dial over the stack's Unix socket. Reconciliations: the app-side DSN duplicate and the DB preflight probe are dropped (postgres is now a DL-260 container the stack starts; up-Ready is the DB verification); stackUpArgs passes only up --state-dir --image --socket and none of the CLI-defaulted postgres/collector/listen flags; the revived files carry the current (linux && gtk4) || darwin build tags; the launch dispatch regains the two-arm switch handing bridge.NewUnixTarget(socket) plus the WhoAmI account id to the bridge service. Preflight v2 widens the OS check to linux|darwin, adds a darwin-only machine-ready seam (its adapter is a later task), drops the DB and uid checks (main's runner is uid-agnostic via the userns keep-id remap), and adds a fatal podman-version floor check that surfaces the podman 4.3+ requirement at the front door instead of deep inside a fire-and-return stack whose exit 0 hides the runner's own refusal. The bring-up timeout is raised to cover a three-image cold pull. shellStartupJS re-parameterizes on the resolved mode.

Ledger-impact: none
Refs RIG-1662
Co-authored-by: Matt Wilkinson <matt@rigel.build>
…RIG-3197)

Review fixes on the embedded-revival T-1+T-2 slice. Add an embedded subtest to TestShellStartupJS asserting the embedded arm emits window.__COMPASS_MODE__="embedded" and omits __COMPASS_SERVER_URL__ (a non-empty server URL is ignored in embedded mode), pinning the OQ-8 startup-global contract the UI embedded boot arm reads; correct the client_test.go doc comment that falsely claimed this arm was already covered. Tighten the launch() bring-up context comment to name the actual call site.

Ledger-impact: none
Refs RIG-1662
Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-native/rig-3197-embedded-dual-mode-supervisor branch from dc94eda to 3b93f1f Compare September 3, 2026 02:42
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review September 3, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant